<template>
  <div>
    <van-nav-bar
      class="topbu"
      title="地图找房"
      left-arrow
      @click-left="$router.go(-1)"
    />
    <baidu-map id="allmap" @ready="mapReady" :scroll-wheel-zoom="true">
    </baidu-map>
  </div>
</template>

<script>
export default {
  name: 'Maphouse',
  props: {},
  data () {
    return {
      point: ''
    }
  },
  methods: {
    mapReady ({ BMap, map }) {
      // 选择一个经纬度作为中心点
      this.point = new BMap.Point(116.404, 39.915)
      map.centerAndZoom(this.point, 12)
    }
  }
}
</script>

<style scoped lang="less">
.topbu {
  position: fixed;
  width: 100%;
  top: 0;
  left: 0;
}
#allmap {
  height: 177vw;
  width: 100%;
  margin: 0 auto;
}
</style>
